<template>
  <div class="layui-form-item">
    <label v-if="isLabel" class="layui-form-label"><slot name="label">{{ label }}</slot></label>
    <div class="layui-input-block">
      <slot></slot>
    </div>
  </div>
</template>
<script>
export default {
  name: 'form-item',
  props: {
    label: {
      type: String,
      default: ''
    }
  },
  computed: {
    isLabel () {
      return this.label !== ''
    }
  }
}
</script>
